Top 50 most Ordered Products

##     order_id          user_id        eval_set         order_number   order_dow   order_hour_of_day days_since_prior_order   product_id    add_to_cart_order   reordered     
##  Min.   :      2   Min.   :     1   prior:32434489   Min.   : 1.00   0:6209666   Min.   : 0.00     Min.   : 0.0           Min.   :    1   Min.   :  1.000   Min.   :0.0000  
##  1st Qu.: 855943   1st Qu.: 51421   test :       0   1st Qu.: 5.00   1:5665856   1st Qu.:10.00     1st Qu.: 5.0           1st Qu.:13530   1st Qu.:  3.000   1st Qu.:0.0000  
##  Median :1711048   Median :102611   train:       0   Median :11.00   2:4217798   Median :13.00     Median : 8.0           Median :25256   Median :  6.000   Median :1.0000  
##  Mean   :1710749   Mean   :102937                    Mean   :17.14   3:3844117   Mean   :13.42     Mean   :11.1           Mean   :25576   Mean   :  8.351   Mean   :0.5897  
##  3rd Qu.:2565514   3rd Qu.:154391                    3rd Qu.:24.00   4:3787215   3rd Qu.:16.00     3rd Qu.:15.0           3rd Qu.:37935   3rd Qu.: 11.000   3rd Qu.:1.0000  
##  Max.   :3421083   Max.   :206209                    Max.   :99.00   5:4209533   Max.   :23.00     Max.   :30.0           Max.   :49688   Max.   :145.000   Max.   :1.0000  
##                                                                      6:4500304                     NA's   :2078068                                                          
##                  product_name         aisle_id      department_id   
##  Banana                :  472565   Min.   :  1.00   Min.   : 1.000  
##  Bag of Organic Bananas:  379450   1st Qu.: 31.00   1st Qu.: 4.000  
##  Organic Strawberries  :  264683   Median : 83.00   Median : 9.000  
##  Organic Baby Spinach  :  241921   Mean   : 71.21   Mean   : 9.922  
##  Organic Hass Avocado  :  213584   3rd Qu.:107.00   3rd Qu.:16.000  
##  Organic Avocado       :  176815   Max.   :134.00   Max.   :21.000  
##  (Other)               :30685471
order_id user_id eval_set order_number order_dow order_hour_of_day days_since_prior_order product_id add_to_cart_order reordered product_name aisle_id department_id
2539329 1 prior 1 2 8 NA 196 1 0 Soda 77 7
2539329 1 prior 1 2 8 NA 14084 2 0 Organic Unsweetened Vanilla Almond Milk 91 16
2539329 1 prior 1 2 8 NA 12427 3 0 Original Beef Jerky 23 19
2539329 1 prior 1 2 8 NA 26088 4 0 Aged White Cheddar Popcorn 23 19
2539329 1 prior 1 2 8 NA 26405 5 0 XL Pick-A-Size Paper Towel Rolls 54 17
2398795 1 prior 2 3 7 15 196 1 1 Soda 77 7
2398795 1 prior 2 3 7 15 10258 2 0 Pistachios 117 19
2398795 1 prior 2 3 7 15 12427 3 1 Original Beef Jerky 23 19
2398795 1 prior 2 3 7 15 13176 4 0 Bag of Organic Bananas 24 4
2398795 1 prior 2 3 7 15 26088 5 1 Aged White Cheddar Popcorn 23 19
2398795 1 prior 2 3 7 15 13032 6 0 Cinnamon Toast Crunch 121 14
473747 1 prior 3 3 12 21 196 1 1 Soda 77 7
473747 1 prior 3 3 12 21 12427 2 1 Original Beef Jerky 23 19
473747 1 prior 3 3 12 21 10258 3 1 Pistachios 117 19
473747 1 prior 3 3 12 21 25133 4 0 Organic String Cheese 21 16
Var1 Freq
Banana 472565
Bag of Organic Bananas 379450
Organic Strawberries 264683
Organic Baby Spinach 241921
Organic Hass Avocado 213584
Organic Avocado 176815
Large Lemon 152657
Strawberries 142951
Limes 140627
Organic Whole Milk 137905
Organic Raspberries 137057
Organic Yellow Onion 113426
Organic Garlic 109778
Organic Zucchini 104823
Organic Blueberries 100060
Cucumber Kirby 97315
Organic Fuji Apple 89632
Organic Lemon 87746
Apple Honeycrisp Organic 85020
Organic Grape Tomatoes 84255
Seedless Red Grapes 82689
Organic Cucumber 80392
Honeycrisp Apple 79769
Organic Baby Carrots 76896
Organic Half & Half 76360
Sparkling Water Grapefruit 75886
Organic Large Extra Fancy Fuji Apple 75165
Yellow Onions 73167
Organic Gala Apples 72846
Organic Baby Arugula 72829
Carrots 72736
Fresh Cauliflower 71584
Original Hummus 71314
Organic Cilantro 69524
Half & Half 69217
Organic Small Bunch Celery 68091
Michigan Organic Kale 67449
Asparagus 67283
Organic Red Onion 66986
Organic Tomato Cluster 64289
Organic Blackberries 61746
100% Whole Wheat Bread 60816
Organic Italian Parsley Bunch 60621
Organic Whole String Cheese 59676
Organic Granny Smith Apple 58779
Organic Unsweetened Almond Milk 57895
Raspberries 57640
Organic Red Bell Pepper 57485
Spring Water 56087
Blueberries 55946

Top 50 most Re-Ordered Products

##     order_id          user_id        eval_set         order_number   order_dow   order_hour_of_day days_since_prior_order   product_id    add_to_cart_order   reordered
##  Min.   :      2   Min.   :     1   prior:19126536   Min.   : 2.00   0:3634366   Min.   : 0.00     Min.   : 0.00          Min.   :    1   Min.   :  1.00    Min.   :1  
##  1st Qu.: 856492   1st Qu.: 51280   test :       0   1st Qu.: 8.00   1:3421285   1st Qu.:10.00     1st Qu.: 5.00          1st Qu.:13629   1st Qu.:  3.00    1st Qu.:1  
##  Median :1710256   Median :102541   train:       0   Median :16.00   2:2487537   Median :13.00     Median : 7.00          Median :25005   Median :  6.00    Median :1  
##  Mean   :1710541   Mean   :102894                    Mean   :21.63   3:2253698   Mean   :13.34     Mean   :10.21          Mean   :25620   Mean   :  7.56    Mean   :1  
##  3rd Qu.:2565059   3rd Qu.:154369                    3rd Qu.:30.00   4:2238166   3rd Qu.:16.00     3rd Qu.:14.00          3rd Qu.:37737   3rd Qu.: 10.00    3rd Qu.:1  
##  Max.   :3421083   Max.   :206209                    Max.   :99.00   5:2506649   Max.   :23.00     Max.   :30.00          Max.   :49688   Max.   :137.00    Max.   :1  
##                                                                      6:2584835                                                                                         
##                  product_name         aisle_id      department_id   
##  Banana                :  398609   Min.   :  1.00   Min.   : 1.000  
##  Bag of Organic Bananas:  315913   1st Qu.: 31.00   1st Qu.: 4.000  
##  Organic Strawberries  :  205845   Median : 83.00   Median : 7.000  
##  Organic Baby Spinach  :  186884   Mean   : 71.34   Mean   : 9.716  
##  Organic Hass Avocado  :  170131   3rd Qu.:107.00   3rd Qu.:16.000  
##  Organic Avocado       :  134044   Max.   :134.00   Max.   :21.000  
##  (Other)               :17715110
order_id user_id eval_set order_number order_dow order_hour_of_day days_since_prior_order product_id add_to_cart_order reordered product_name aisle_id department_id
2398795 1 prior 2 3 7 15 196 1 1 Soda 77 7
2398795 1 prior 2 3 7 15 12427 3 1 Original Beef Jerky 23 19
2398795 1 prior 2 3 7 15 26088 5 1 Aged White Cheddar Popcorn 23 19
473747 1 prior 3 3 12 21 196 1 1 Soda 77 7
473747 1 prior 3 3 12 21 12427 2 1 Original Beef Jerky 23 19
473747 1 prior 3 3 12 21 10258 3 1 Pistachios 117 19
2254736 1 prior 4 4 7 29 196 1 1 Soda 77 7
2254736 1 prior 4 4 7 29 12427 2 1 Original Beef Jerky 23 19
2254736 1 prior 4 4 7 29 10258 3 1 Pistachios 117 19
2254736 1 prior 4 4 7 29 25133 4 1 Organic String Cheese 21 16
2254736 1 prior 4 4 7 29 26405 5 1 XL Pick-A-Size Paper Towel Rolls 54 17
431534 1 prior 5 4 15 28 196 1 1 Soda 77 7
431534 1 prior 5 4 15 28 12427 2 1 Original Beef Jerky 23 19
431534 1 prior 5 4 15 28 10258 3 1 Pistachios 117 19
431534 1 prior 5 4 15 28 25133 4 1 Organic String Cheese 21 16
Var1 Freq
Banana 398609
Bag of Organic Bananas 315913
Organic Strawberries 205845
Organic Baby Spinach 186884
Organic Hass Avocado 170131
Organic Avocado 134044
Organic Whole Milk 114510
Large Lemon 106255
Organic Raspberries 105409
Strawberries 99802
Limes 95768
Organic Yellow Onion 79072
Organic Garlic 74663
Organic Zucchini 72165
Cucumber Kirby 67313
Organic Fuji Apple 63811
Organic Blueberries 62922
Apple Honeycrisp Organic 62510
Organic Lemon 60536
Organic Half & Half 59672
Sparkling Water Grapefruit 58513
Honeycrisp Apple 57818
Organic Large Extra Fancy Fuji Apple 57201
Organic Cucumber 56051
Organic Grape Tomatoes 55230
Seedless Red Grapes 55177
Organic Gala Apples 53406
Half & Half 52728
Original Hummus 51690
Organic Baby Carrots 50472
Organic Baby Arugula 49798
Michigan Organic Kale 46841
Carrots 46572
Fresh Cauliflower 45969
Organic Whole String Cheese 45639
Spring Water 45558
100% Whole Wheat Bread 44834
Organic Unsweetened Almond Milk 43875
Yellow Onions 43269
Organic Cilantro 43103
Organic Small Bunch Celery 42971
Organic Tomato Cluster 42261
Asparagus 41585
Organic Granny Smith Apple 41566
Organic Red Onion 41329
Organic Blackberries 40295
Raspberries 39507
Organic Reduced Fat 2% Milk 38544
Organic Red Bell Pepper 37968
Hass Avocados 37365

Finiding unique products which are not reordered

Organic Italian Parsley Bunch & Blueberries are 2 products which are part of highest ordered products but are not part of the top 50 re-ordered products

##                            Var1  Freq
## 1 Organic Italian Parsley Bunch 60621
## 2                   Blueberries 55946

1. Order hour of the day vs number of orders of customers

To find out what time of the day most orders are placed

order_hour_of_day order_number count
15 3 17657
15 4 17528
14 2 17318
15 2 17312
14 4 17308
15 1 17264
14 3 17223
16 4 17157
16 1 17094
16 2 17082

### 2. Order Day of the week vs the Order Hour of the day

order_dow order_hour_of_day count
1 10 55671
0 14 54552
0 15 53954
0 13 53849
1 9 51908
1 11 51584

3. After How many days do customers place a Re-Order?

7th Day and the 30th day is when people reorder the most

4. Finding out total %ge of products which are reordered

As you can se about 60% products are generally reordered

reordered count percentage
0 13307953 0.4103025
1 19126536 0.5896975

Maximum Product varieties in each Department

‘Personal Care’ and ‘Snacks’ has the maximum product varieties

department_id count department
11 6563 personal care
19 6264 snacks
13 5371 pantry
7 4365 beverages
1 4007 frozen
16 3449 dairy eggs
17 3085 household
15 2092 canned goods
9 1858 dry goods pasta
4 1684 produce
3 1516 bakery
20 1322 deli
21 1258 missing
6 1139 international
14 1115 breakfast
18 1081 babies
8 972 pets
12 907 meat seafood
2 548 other
10 38 bulk

5. Products from which Departments are ordered the most ?

order_id department
2 dairy eggs
2 produce
2 pantry
2 pantry
2 pantry
2 produce
2 pantry
2 pantry
2 produce
3 dairy eggs
## [1] 32434489        2
## [1] 21
Var1 Freq
produce 9479291
dairy eggs 5414016
snacks 2887550
beverages 2690129
frozen 2236432
pantry 1875577
bakery 1176787
canned goods 1068058
deli 1051249
dry goods pasta 866627
household 738666
breakfast 709569
meat seafood 708931
personal care 447123
babies 423802
international 269253
alcohol 153696
pets 97724
missing 69145
other 36291
bulk 34573

6. Products from which from which Departments are reordered the most?

order_id department
2 dairy eggs
2 produce
2 pantry
2 produce
2 pantry
2 pantry
3 dairy eggs
3 dairy eggs
3 produce
3 produce
## [1] 19126536        2
## [1] 21
Var1 Freq
produce 6160710
dairy eggs 3627221
beverages 1757892
snacks 1657973
frozen 1211890
bakery 739188
pantry 650301
deli 638864
canned goods 488535
meat seafood 402442
dry goods pasta 399581
breakfast 398013
household 297075
babies 245369
personal care 143584
international 99416
alcohol 87595
pets 58760
missing 27371
bulk 19950
other 14806

7. Change in the Department rank during the reorder

Beverages jump to 3rd position compared to 4th during the first order
Bakery jumps to 6th position during reordered compared to 7th in the first order
Deli jumps to 8th position during reorder compared to 9th in the first order
Similarly ‘Breakfast’ & ‘meat seafood’ also jumps up one position during the reorder compared to first time order

##               Var1  Freq.x  Freq.y
## 1          produce 9479291 6160710
## 2       dairy eggs 5414016 3627221
## 3           snacks 2887550 1657973
## 4        beverages 2690129 1757892
## 5           frozen 2236432 1211890
## 6           pantry 1875577  650301
## 7           bakery 1176787  739188
## 8     canned goods 1068058  488535
## 9             deli 1051249  638864
## 10 dry goods pasta  866627  399581
## 11       household  738666  297075
## 12       breakfast  709569  398013
## 13    meat seafood  708931  402442
## 14   personal care  447123  143584
## 15          babies  423802  245369
## 16   international  269253   99416
## 17         alcohol  153696   87595
## 18            pets   97724   58760
## 19         missing   69145   27371
## 20           other   36291   14806
## 21            bulk   34573   19950

Maximum Product varieties in each Aisles

‘Personal Care’ and ‘Snacks’ has the maximum product varieties

aisle_id count aisle
47 1038 vitamins supplements
120 1026 yogurt
94 894 tea
21 891 packaged cheese
104 797 spices seasonings
69 737 soup broth bouillon
31 675 refrigerated
123 615 packaged vegetables fruits
117 582 nuts seeds dried fruit
20 565 oral hygiene
89 560 salad dressing toppings
25 525 soap
88 493 spreads
77 463 soft drinks
110 402 pickled goods olives
9 399 pasta sauce
19 375 oils vinegars
115 344 water seltzer sparkling water
65 325 protein meal replacements
54 322 paper goods
13 317 prepared meals
23 316 popcorn jerky
87 308 more household
91 293 soy lactosefree
2 271 specialty cheeses
51 264 preserved dips spreads
109 245 skin care
84 243 milk
128 241 tortillas flat bread
28 232 red wines
111 199 plates bowls cups flatware
55 198 shave needs
124 195 spirits
108 191 other creams cheeses
133 172 muscles joints pain relief
46 168 mint gum
14 159 tofu meat alternatives
62 147 white wines
1 146 prepared soups salads
60 112 trash bags liners
122 105 meat counter
7 100 packaged meat
49 99 packaged poultry
71 98 refrigerated pudding desserts
134 95 specialty wines champagnes
35 82 poultry counter
15 80 packaged seafood
125 69 trail mix snack mix
39 54 seafood counter
32 32 packaged produce

Top 50 highest ordered Aisles?

order_id aisle
2 eggs
2 fresh vegetables
2 spices seasonings
2 oils vinegars
2 baking ingredients
2 fresh vegetables
2 doughs gelatins bake mixes
2 spreads
2 packaged vegetables fruits
3 yogurt
## [1] 32434489        2
## [1] 134
Var1 Freq
fresh fruits 3642188
fresh vegetables 3418021
packaged vegetables fruits 1765313
yogurt 1452343
packaged cheese 979763
milk 891015
water seltzer sparkling water 841533
chips pretzels 722470
soy lactosefree 638253
bread 584834
refrigerated 575881
frozen produce 522654
ice cream ice 498425
crackers 458838
energy granola bars 456386
eggs 452134
lunch meat 395130
frozen meals 390299
baby food formula 382456
fresh herbs 377741
cereal 377586
soft drinks 357537
fresh dips tapenades 355685
soup broth bouillon 346464
juice nectars 333933
baking ingredients 326692
cream 318002
other creams cheeses 308007
nuts seeds dried fruit 306487
hot dogs bacon sausage 305655
candy chocolate 300567
canned jarred vegetables 297037
spreads 289400
packaged produce 276028
canned meals beans 270314
dry pasta 266637
butter 254317
breakfast bakery 250770
tea 249341
oils vinegars 245466
paper goods 242996
cookies cakes 234065
frozen breakfast 232763
condiments 222049
pasta sauce 218387
spices seasonings 212092
coffee 207075
instant foods 200687
frozen appetizers sides 194582
tortillas flat bread 193297

Top 50 highest reordered Aisles?

order_id product_id add_to_cart_order reordered product_name aisle_id department_id aisle
2 33120 1 1 Organic Egg Whites 86 16 eggs
2 28985 2 1 Michigan Organic Kale 83 4 fresh vegetables
2 45918 4 1 Coconut Butter 19 13 oils vinegars
2 17794 6 1 Carrots 83 4 fresh vegetables
2 40141 7 1 Original Unflavored Gelatine Mix 105 13 doughs gelatins bake mixes
2 1819 8 1 All Natural No Stir Creamy Almond Butter 88 13 spreads
3 33754 1 1 Total 2% with Strawberry Lowfat Greek Strained Yogurt 120 16 yogurt
3 24838 2 1 Unsweetened Almondmilk 91 16 soy lactosefree
3 17704 3 1 Lemons 123 4 packaged vegetables fruits
3 21903 4 1 Organic Baby Spinach 123 4 packaged vegetables fruits
## [1] 19126536        8
## [1] 134
Var1 Freq
fresh fruits 2615469
fresh vegetables 2032172
packaged vegetables fruits 1127177
yogurt 997018
milk 696264
water seltzer sparkling water 613977
packaged cheese 573383
soy lactosefree 442023
chips pretzels 425387
bread 391937
refrigerated 381983
eggs 318920
frozen produce 283033
energy granola bars 272922
crackers 261145
ice cream ice 245400
lunch meat 239653
soft drinks 228406
baby food formula 225748
cream 217846
frozen meals 217262
fresh dips tapenades 216232
cereal 215822
juice nectars 197733
fresh herbs 195230
packaged produce 190662
other creams cheeses 174047
candy chocolate 172313
hot dogs bacon sausage 170005
breakfast bakery 163307
nuts seeds dried fruit 159119
butter 146496
soup broth bouillon 145984
frozen breakfast 145761
spreads 141121
canned meals beans 136348
tea 131556
cookies cakes 128431
coffee 128330
paper goods 128303
canned jarred vegetables 125096
dry pasta 120803
tortillas flat bread 106546
pasta sauce 104597
fruit vegetable snacks 104121
frozen appetizers sides 102264
baking ingredients 99668
instant foods 98243
popcorn jerky 96804
frozen pizza 94283

Unique Aisles which are not reordered again

‘oils vinegars’, condiments, ‘spices seasonings’ are three aisles which are not reordered within 30 days

##                Var1   Freq
## 1     oils vinegars 245466
## 2        condiments 222049
## 3 spices seasonings 212092

Looking into Customers - Highest Ordered products in the First Order

##     user_id        order_number   product_id                    product_name    
##  Min.   :     1   Min.   :1     Min.   :    1   Banana                :  29534  
##  1st Qu.: 51555   1st Qu.:1     1st Qu.:13575   Bag of Organic Bananas:  19158  
##  Median :102848   Median :1     Median :25490   Organic Strawberries  :  16464  
##  Mean   :102985   Mean   :1     Mean   :25607   Organic Avocado       :  15187  
##  3rd Qu.:154518   3rd Qu.:1     3rd Qu.:37999   Organic Baby Spinach  :  14948  
##  Max.   :206209   Max.   :1     Max.   :49688   Organic Hass Avocado  :  11106  
##                                                 (Other)               :1971671
user_id order_number product_id product_name
1 1 196 Soda
1 1 14084 Organic Unsweetened Vanilla Almond Milk
1 1 12427 Original Beef Jerky
1 1 26088 Aged White Cheddar Popcorn
1 1 26405 XL Pick-A-Size Paper Towel Rolls
2 1 32792 Chipotle Beef & Pork Realstick
2 1 47766 Organic Avocado
2 1 20574 Roasted Turkey
2 1 12000 Baked Organic Sea Salt Crunchy Pea Snack
2 1 48110 Thin Stackers Brown Rice Lightly Salted
2 1 22474 Cheddar Bunnies Snack Crackers
2 1 16589 Plantain Chips
2 1 35917 Organic Just Concord Grape Juice
2 1 27344 Uncured Genoa Salami
2 1 30489 Original Hummus
Var1 Freq
Banana 29534
Bag of Organic Bananas 19158
Organic Strawberries 16464
Organic Avocado 15187
Organic Baby Spinach 14948
Organic Hass Avocado 11106
Strawberries 8660
Limes 8598
Large Lemon 8360
Organic Whole Milk 7223
Organic Blueberries 7102
Cucumber Kirby 6677
Organic Garlic 6613
Organic Raspberries 6379
Yellow Onions 6157
## [1] 50

Which products out of the highest ordered products, are not part of the first order of the customer

These 4 products inspite of being part of highest ordered products, are not ordered during the first order by the customers 1 Organic Whole String Cheese 59676 2 Organic Granny Smith Apple 58779 3 Organic Unsweetened Almond Milk 57895 4 Spring Water 56087

##                              Var1  Freq
## 1     Organic Whole String Cheese 59676
## 2      Organic Granny Smith Apple 58779
## 3 Organic Unsweetened Almond Milk 57895
## 4                    Spring Water 56087

Avg no of products in the first order of the customer

Mean :10.08 means, on an average customer purchases 10 products in the first order

##     user_id        order_number      cnt       
##  Min.   :     1   Min.   :1     Min.   : 1.00  
##  1st Qu.: 51553   1st Qu.:1     1st Qu.: 5.00  
##  Median :103105   Median :1     Median : 8.00  
##  Mean   :103105   Mean   :1     Mean   :10.08  
##  3rd Qu.:154657   3rd Qu.:1     3rd Qu.:14.00  
##  Max.   :206209   Max.   :1     Max.   :98.00
user_id order_number cnt
1 1 5
2 1 13
3 1 10
4 1 4
5 1 11
6 1 4
7 1 12
8 1 21
9 1 30
10 1 5
11 1 13
12 1 3
13 1 5
14 1 5
15 1 4